package com.lbw.prototype;

/**
 * @author lbw
 * @version 1.0
 * @date 2021/10/17 22:03
 */
public class Client {

    public static void main(String[] args) throws CloneNotSupportedException {
        Sheep sheep1 = new Sheep("肖恩", 1, "黑色");
        Sheep sheep3 = new Sheep("夏利", 23, "黄");
        Sheep sheep4 = new Sheep("小明", 23, "黄");
        sheep1.setFriend(sheep3);
        Sheep sheep2 = (Sheep) sheep1.clone();

        System.out.println(sheep1);
        System.out.println(sheep2);
        sheep1.getFriend().setAge(123);

        System.out.println("改变sheep1后");
        System.out.println(sheep1);
        System.out.println(sheep2);

    }
}
